//
//  MoCustomAlert.swift
//  takeaway
//
//  Created by zhuxietong on 2021/2/21.
//

import Foundation
import Eelay
open class MoCustomAlert<Alert:DialogContent>:MoDialog<Alert>{
    open override func defaultStyle() -> [UICss] {
        return [.size(CGSize(width: Swidth-60, height: Swidth-60)),.offsetY(-100.co)]
    }
    public override func mo_model_reload() {
        node.mo.model = mo.model
    }
    
    open override func layTable(tableView: UIView) {
        
        jo_contentView.setEeLays(lays: [
            [titleLabel,[ee.T.L.R,[16,45,-45]]],
            [closeBt,[titleLabel,ee.T,0],[ee.R,-12],"26",26],
            [tableView,[ee.L.R],[titleLabel,ee.B,ee.T,10],[footerBri,ee.T,ee.B,0]],
            [footerBri,[ee.L.B.R]],
        ])
//        closeBt.ui.nimage(UIImage(named: "delete_tag"))

        
        closeBt.addTarget(self, action: #selector(hidden), for: .touchUpInside)
        node.updatedSize = {
            [weak self] size in
            guard let `self` = self else {
                return
            }
            self.contentHeight = size.height
        }
        footerBri.updateSize = {
            [weak self] size in
            guard let `self` = self else {
                return
            }
//            print("___OOOOOO\(size)")
            self.footerHeight = size.height
        }
        
        footer.arrange = arrange
        footerBri.node = footer

        titleLabel.ui.font17.text(color: ._foreground).left.text(obj["title",""])
        node.alert = self
    }
    open override func viewDidLoad() {
        super.viewDidLoad()
    }
    

    
}

